define(function(require){
    var $ = require('$');
    var Table = require('gallery/table/0.0.1/table-debug'); 
    function resize(){
        var h = (document.documentElement.clientHeight - 79) + 'px';

        $('.body-wrap').css('height',h);
    }

    resize();

    $(document).resize(function(){
        resize();
    });

    // var rows = [
    //     {user_id:'XX0901001',child_user_id:1378763201,status:'正常',post:'CTO',name:'王XX',phone:'13868683838',email:'222@124.com',edit:'xx'},
    //     {user_id:'XX0901001',child_user_id:1378763201,status:'正常',post:'CTO',name:'王XX',phone:'13868683838',email:'222@124.com',edit:'xx'}        
    // ]

    // var table = new Table({
    //     element:'.table-wrap',
    //     checkbox: true,
    //     column:[
    //         {text:'账号ID',value:'user_id',width:'100px'},
    //         {text:'子账号',value:'child_user_id',width:'100px'},
    //         {text:'状态',value:'status',width:'80px'},
    //         {text:'职位',value:'post',width:'80px'},
    //         {text:'姓名',value:'name',width:'80px'},
    //         {text:'手机号码',value:'phone',width:'80px'},
    //         {text:'邮箱',value:'email',width:'80px'},
    //         {text:'操作',value:'edit',width:'160px',formmat:''},            
    //     ],
    //     row:rows
        
    // });
    
    //点击全选或全不选
    var $thCheckbox = $('.i-table th input'),
    $tdCheckbox = $('.i-table td input');
    $thCheckbox.on('click',function(){
    	if($(this).attr('checked')){
    		$tdCheckbox.each(function(){
    			$(this).attr('checked',true);
    		});
    	}else{
    		$tdCheckbox.each(function(){
    			$(this).attr('checked',false);
    		});
    	}
    });
    
    //点击停用弹窗显示,点击取消弹窗消失
    var $stopUseBtn = $('.stop-use'),
    $alert = $('.stop-alert'),
    $cancelBtn = $('.btn-cancel');
    $stopUseBtn.on('click',function(){
    	$alert.show();
    	$cancelBtn.on('click',function(){
    		$alert.hide();
    	})
    });
});